//
// Created by hsj on 2021/12/30.
//
#include "iostream"
#include "cast_t.h"

//强制类型转换测试
void test_cast(){
    using namespace std;
    int i = 18;
    long l = (long)i;
    long lo = long(i);
    cout<<i<<endl;
    cout<<l<<endl;
    cout<<lo<<endl;

//    特殊的强制类型转换
    long esp = static_cast<long> (i);
    cout<<esp<<endl;
    //字面值默认int类型
    long esply = static_cast<long> (100);
    cout<<esply<<endl;
}